package com.example.healthapp.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

// 数据库创建帮助类
public class DBOpenHelper extends SQLiteOpenHelper {

    //创建表语句
    String friendShareTable = "create table friendShareTable(" + "id integer primary key autoincrement," + "content text," + "date text" + ")";
    String otherGeneral = "create table if not exists otherGeneral(id integer primary key autoincrement,name text,sex text)";  //通用

    public DBOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(friendShareTable);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}